# Contributor: Assaf Gordon <assafgordon@gmail.com>
# Maintainer: Celeste <cielesti@protonmail.com>
pkgname=datamash
pkgver=1.8
pkgrel=1
pkgdesc="Command-line text/math processing"
url="https://www.gnu.org/software/datamash/"
arch="all"
license="GPL-3.0-or-later"
subpackages="$pkgname-doc $pkgname-bash-completion"
source="https://ftpmirror.gnu.org/datamash/datamash-$pkgver.tar.gz"

build() {
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--sysconfdir=/etc \
		--mandir=/usr/share/man \
		--infodir=/usr/share/info \
		--localstatedir=/var \
		--disable-nls \
		--disable-werror \
		--with-bash-completion-dir=/usr/share/bash-completion/completions
	make
}

check() {
	make check
}

package() {
	make -j1 DESTDIR="$pkgdir" install

	rm -vrf "$pkgdir"/usr/share/datamash/examples
	rmdir -v "$pkgdir"/usr/share/datamash
}

sha512sums="
5ef312a73ebee5df7308b7e368f296714fcc396761499d4a5ba94906f6ecdb0867193c5ce25668bf56b7a5339a8a833a98b3ad564c01544880a6ec210c7b922a  datamash-1.8.tar.gz
"
